Adds a record or records to the grid.

<div class="definition">
    add(record, [first])
</div>

<div class="arguments">
    <table>
    <tr>
        <td>record</td>
        <td><b>object</b> or <b>array</b>, record(s) to add</td>
    </tr>
    <tr>
        <td>first</td>
        <td><b>boolean</b>, <i>optional</i>, indicates that record/s would be added to first</td>
    </tr>
    </table>
</div>
Returns integer.

<h4>Description</h4>

Adds a record or records to the grid by adding them into the <a class="property" href="w2grid.records">.records</a> array and calling the
<a class="method" href="w2grid.refresh">.refresh()</a> method.
The first argument <span class="argument">record</span> is the record object or an array of record objects. If you add multiple records
at a time, it will only refresh the grid after all of them were added.
Setting the second argument <span class="argument">first</span> to <i>true</i>, the records would be added to first line. By default
records are inserted to the end of the grid.
<div style="height: 10px"></div>

Returns the number of records it adds.
<div style="height: 10px"></div>

If you define grid as:
<textarea class="javascript">
let grid = new w2grid({
    name    : 'grid',
    columns: [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%' },
        { field: 'fname', text: 'First Name', size: '30%' },
        { field: 'email', text: 'Email', size: '40%' },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ],
    records: [
        { recid: 1, fname: 'John', lname: 'doe', email: 'vitali@gmail.com', sdate: '1/3/2012' },
        { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '2/4/2012' }
    ]
});
</textarea>

You can add records by:
<textarea class="javascript">
grid.add({ recid: 3, fname: 'Jin', lname: 'Franson', email: '--', sdate: '4/23/2012' });
</textarea>
or several at a time:
<textarea class="javascript">
grid.add([
    { recid: 4, fname: 'Susan', lname: 'Ottie', email: 'jdoe@gmail.com', sdate: '5/3/2012' },
    { recid: 5, fname: 'Kelly', lname: 'Silver', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
    { recid: 6, fname: 'Francis', lname: 'Gatos', email: 'vitali@gmail.com', sdate: '2/5/2012' }
]);
</textarea>

See <a class="method" href="w2grid.records">.records</a> array for the structure of the record object.
